cmake_minimum_required(VERSION 2.8.3)
project(front_slam)
SET(CMAKE_BUILD_TYPE "Release")
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++14)


ADD_COMPILE_OPTIONS(-std=c++14 )
set( CMAKE_CXX_FLAGS "-std=c++14 -O3" )
add_definitions(-DROOT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\")

# 启动代码调试功能
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions" )
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14  -Wall -g -pthread -std=c++0x -std=c++14 -fexceptions")



## Find catkin macros and libraries
# find_package(gtsam REQUIRED)

find_package(OpenCV REQUIRED QUIET)
find_package(Boost REQUIRED COMPONENTS thread system filesystem)

# find_package(Eigen3 REQUIRED)

## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  nav_msgs
  # nav_msgs


  gtsam_catkin
  pcl_ros
  distributed_mapper_catkin
  pcl_catkin
  dcl_slam
)

## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES las2pcd
CATKIN_DEPENDS 
roscpp 
rospy 
std_msgs 
nav_msgs  
distributed_mapper_catkin
dcl_slam 
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
  ${catkin_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
  ${liblas_INCLUDE_DIRS}
  ${OpenCV_LIBRARY_DIRS}
  
)

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/Front_slam_node.cpp)


# add_executable(LAS2PCD src/laserMapping.cpp include/ikd-Tree/ikd_Tree.cpp src/preprocess.cpp)
# target_link_libraries(fastlio_mapping ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${PYTHON_LIBRARIES} ${libnabo_LIBRARIES})
# target_include_directories(fastlio_mapping PRIVATE ${PYTHON_INCLUDE_DIRS})

add_executable(dclFront src/dclFront.cpp)
target_link_libraries(dclFront ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${PYTHON_LIBRARIES} ${libnabo_LIBRARIES} ${liblas_LIBRARIES} ${GTSAM_LIBRARIES})
target_include_directories(dclFront PRIVATE ${PYTHON_INCLUDE_DIRS})
